<%@page import="edu.tsinghua.eea.powermanagementserver.model.SimDataGenerator"%>
<%@page import="edu.tsinghua.eea.powermanagement.data.PlugInfoCell"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="edu.tsinghua.eea.powermanagement.data.PCDataCell"%>
<%@page import="edu.tsinghua.eea.powermanagement.data.PowerConsumptionData"%>
<%@page import="java.util.Vector"%>
<%@page import="edu.tsinghua.eea.powermanagementserver.model.DBInterface"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="edu.tsinghua.eea.powermanagement.data.HomeInfo"%>
<%Vector<PlugInfoCell> vplug = (Vector<PlugInfoCell>)request.getSession().getAttribute("plugs"); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
</style>
<link href="css/rf_style.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="js/calendarDateInput.js"></script>
</head>
<body>
	<div style="background: #FFFFFF;">
		<div id="xsnazzy">
			<b class="xtop">
				<b class="xb1"></b><b class="xb2 gray_back"></b><b class="xb3 gray_back"></b>
				<b class="xb4 gray_back"></b><b class="xb5 gray_back"></b>
			</b>
			<div class="xboxcontent">
				<div class="top_title">
					模拟数据生成
				</div>
				<jsp:include page="server_message.jsp"></jsp:include>
				<div class='fleft inner_title'>
					模拟数据生成
				</div>
				<form id="sim_form" action="dbcon" method="get">
					<input name="action" type="hidden" value="<%=DBInterface.ACTION_SIM_DATA %>" />
					<input name="sim_plug_id" type="hidden" value="1" />
					<input name="sim_type_id" type="hidden" value="1" />
					<input name="sim_date" type="hidden" value="0" />
					<input name="sim_min" type="hidden" value="0" />
					<input name="sim_max" type="hidden" value="100" />
					<input name="sim_smax" type="hidden" value="1" />
				</form>
				<div class='fleft wfill next_level'>
					<div class="fleft">
						<div class="sim_line">
							<div class="fleft sim_label">
								模拟数据源
							</div>
							<div class="fleft">
								<select id="plugid" class="sim_field" style="font-size: 90%;" onchange="setvalue_plug();">
									<%if(vplug == null || vplug.size() <= 0){ %>
									<option value="0">本用户暂无插座</option>
									<%} else {
										for(int i=0; i<vplug.size(); i++){%>
										<option value="<%=vplug.get(i).mID %>">
											<%=vplug.get(i).mID+": "+vplug.get(i).mMAC %>
										</option>
										<%} %>
									<%} %>
								</select>
							</div>
							<div class="clear"></div>
						</div>
						<div class="sim_line">
							<div class="sim_label fleft">
								模拟数据类型
							</div>
							<div class="fleft">
								<select id="typeid" class="sim_field" style="font-size: 90%;" onchange="setvalue_type();">
									<%for(int i=0; i<SimDataGenerator.SIM_TYPE_INDEX.length; i++){ %>
									<option value="<%=SimDataGenerator.SIM_TYPE_INDEX[i] %>">
										<%=SimDataGenerator.SIM_TYPE_DESCRIPTION[i] %>
									</option>
									<%} %>
								</select>
							</div>
							<div class="clear"></div>
						</div>
						<div class="sim_line">
							<div class="sim_label fleft">
								模拟数据日期
							</div>
							<div class="fleft" onmouseout="setvalue_date();">
								<script>DateInput('input_date', true, 'YYYY-MM-DD')</script>
							</div>
							<div class="clear"></div>
						</div>
					</div>
					<div id="sim_total_random" class="myblock fleft" style="margin-left:1em;">
						<div class="fleft">
							<div class="sim_label">随机功率最小值</div>
							<div>
								<input name="input_min" class="sim_field" type="text" value="0"
									onchange="setvalue_min();" onmouseover="this.select();" />
							</div>
							<div class="sim_label">随机功率最大值</div>
							<div>
								<input name="input_max" class="sim_field" type="text"
									value="100" onchange="setvalue_max();"
									onmouseover="this.select();" />
							</div>
						</div>
						<div id="param_slope_random" class="fleft" style="padding-left:5px;display:none;">
							<div class="sim_label">随机增量最大值</div>
							<div>
								<input name="input_smax" class="sim_field" type="text"
									value="1" onchange="setvalue_smax();"
									onmouseover="this.select();" />
							</div>
						</div>
						<div class="clear"></div>
					</div>
				</div>
				<div class="fleft next_level wfill">
					<input id="submit_btn" type="button" value="提交" onclick="sim_submit();"/>
				</div>
				<div class='clear'></div>
			</div>
		</div>
		<b class="xbottom">
			<b class="xb5"></b><b class="xb5"></b><b class="xb4"></b>
			<b class="xb3"></b><b class="xb2"></b><b class="xb1"></b>
		</b>
	</div>
</body>
</html>